package com.mongodb.study.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

/**
 * @author yangheng
 * @version 1.0
 * @date 2024/8/25 9:32
 */
@Document("study_first")
@Data
public class MongoStudy {

    /**
     * id
     */
    @Id
    Long userId;

    /**
     * name
     */
    @Field("study_name")
    String name;

    /**
     * date
     */
    Date date;


    public MongoStudy(Long userId, String name, Date date) {
        this.userId = userId;
        this.name = name;
        this.date = date;
    }

    public MongoStudy() {
    }
}
